package me.zhengjie.modules.fund.service.dto;

import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
public class UserFundDto extends BaseDTO implements Serializable {
    private static final long serialVersionUID = -4470839326691701033L;

    private Long id;

    private Long userId;

    /**
     * 基金编码
     */
    private String fundCode;

    /**
     * 基金名称
     */
    private String fundName;

    /**
     * 基金类型
     */
    private Integer fundType;

    /**
     * 购买渠道  1：蚂蚁财富 2 天天基金 3 京东金融 4 招商银行
     */
    private Integer purchaseChannel;

    /**
     * 当月交易金额
     */
    private BigDecimal dealAmountOfCurrentMonth = BigDecimal.ZERO;

    /**
     * 当月交易在途
     */
    private BigDecimal dealAmountOfCurrentMonthOnOrder = BigDecimal.ZERO;

    /**
     * 持仓份额
     */
    private BigDecimal count;

    /**
     * 持仓成本
     */
    private BigDecimal principalNetValue;

    /**
     * 成本金额
     */
    private BigDecimal principalAmount;

    /**
     * 最新净值
     */
    private BigDecimal newestNetValue;

    /**
     * 持仓金额（以最新净值计算)
     */
    private BigDecimal newestAmount;

    /**
     * 最新净值更新时间
     */
    private Date newestUpdatedDate;

    /**
     * 当前利润金额
     */
    private BigDecimal profitAmount;

    /**
     * 当前利润比率
     */
    private Double profitRate;

    /**
     * 期初金额 = 期初份额 * 期初净值 + 期初在途金额
     * 期初金额 = 上期期末金额
     */
    private BigDecimal startAmountOfCurrentMonth;

    /**
     * 当月盈利金额：当月利润 = 最新持仓金额 - 期初金额 - 当月转入转出金额
     */
    private BigDecimal profitAmountOfCurrentMonth;

    /**
     * 当月盈利比率：当月盈利金额 /
     */
    private Double profitRateOfCurrentMonth;

    private BigDecimal profitAmountOfYesterday;

    private Double profitRateOfYesterday;
}
